﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using SharePointUtilitiesForDevelopers.Mapper;
using SharePointUtilitiesForDevelopers.Tests.Mapper;

namespace SharePointUtilitiesForDevelopers.Tests
{
    /// <summary>
    /// Test class for <see cref="SharePointListItemExtensionMethods"/>.
    /// </summary>
    [TestClass]
    public class SharePointListItemExtensionMethodsTest
    {
        [TestMethod]
        public void ToBatchUpdateXElement_returns_correct_xml()
        {
            var listItemsXml = ServiceResponseTestHelper.LoadXml("GetListItemsFromList.xml");
            var mapper = new SharePointListItemMapper();
            var listItems = mapper.MapList(listItemsXml);
            var batch = listItems.ToBatchDeleteXElement("0");
            Assert.IsNotNull(batch);
        }
    }
}
